##########################################
## Copyright 2012-2013 Ceruti Francesco & contributors
##
## This file is part of LiSP (Linux Show Player).
##########################################

from PyQt4.QtCore import pyqtSignal, QEvent
from PyQt4.QtGui import QLabel


class QClickLabel(QLabel):

    clicked = pyqtSignal(QEvent)

    def __init(self, parent):
        super(QLabel, self).__init__(parent)

    def mouseReleaseEvent(self, e):
        if(self.contentsRect().contains(e.pos())):
            self.clicked.emit(e)
